package vtc;

import java.util.concurrent.*;
import java.util.*;

public class FunctionalUnitExample extends FunctionalUnit
{
	FunctionalUnitExample(String id, VtcArrayBlockingQueue inQueues[], VtcArrayBlockingQueue outQueues[])
	{
		super(id, inQueues, outQueues);
	}
	
	public void functionalProcess() throws InterruptedException
	{
		Double value = (Double)inValue_.getEvent() * 2;
		Date date = inValue_.getTimeTag();
		outValue_ = new VtcTimeTaggedEvent(value, date);
		try
		{
			TimeUnit.MILLISECONDS.sleep(10);
		}
		catch(InterruptedException e)
		{ 
			System.out.print("Interrupted during sleep in FunctionalUnitExample::functionalProcess()");
		}
	}
}